package com.arouter;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.arouter.bean.UserBean;
import com.cjt2325.cameraview.R;

@Route(path = "/test/activity2")
public class ARouterActivity2 extends AppCompatActivity {

    @Autowired
    public long key1;

    @Autowired
    public boolean key2;

    @Autowired
    public String key3;

    @Autowired
    public UserBean key4;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_arouter2);

        //重点加上这个
        ARouter.getInstance().inject(this);

        TextView tv_parmas = (TextView) findViewById(R.id.tv_parmas);

        String parmas = String.format("key1=%1$s\nkey2=%2$s\nkey3=%3$s\nkey4=%4$s", key1, key2, key3, key4.toString());

        tv_parmas.setText(parmas);
    }
}
